
#include <string.h>
#include <gtk/gtk.h>


#include <v4li/v4li.h>

#include <util/mem.h>

#include "camcal.h"
#include "camcal_events.h"

static void __build(CamCal * cc) {

	GtkHBox * HBOX;
	GtkVBox * vbox;
	GtkFrame * frame;

	HBOX = GTK_HBOX(gtk_hbox_new(FALSE, 2));

	frame = GTK_FRAME(gtk_frame_new("Camera"));
	gtk_box_pack_start(GTK_BOX(HBOX), GTK_WIDGET(frame), TRUE, TRUE, 0);

	cc->da_image = GTK_DRAWING_AREA(gtk_drawing_area_new());
	gtk_widget_add_events(GTK_WIDGET(cc->da_image), GDK_ALL_EVENTS_MASK);
	gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(cc->da_image));
	gtk_widget_set_size_request(GTK_WIDGET(cc->da_image), 320, 240);

	vbox = GTK_VBOX(gtk_vbox_new(FALSE, 2));
	gtk_box_pack_end(GTK_BOX(HBOX), GTK_WIDGET(vbox), TRUE, TRUE, 0);

	cc->v4li = V4L_INTERFACE(v4l_interface_new());
	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(cc->v4li), FALSE, TRUE, 0);

	//frame = __build_calibre_frame(cc);
	//gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(frame), FALSE, TRUE, 0);

	cc->box = GTK_HBOX( HBOX );

}
CamCal * cc_new(void) {
	CamCal * cc;

	cc = mem_alloc(CamCal);
	
	__build(cc);
	__camcal_init_events(cc);

	return cc;
}


